//封装cookie

import Cookies from 'js-cookie'
const tokenKey = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJsdjExMTEiLCJpYXQiOjE2NDU3NjAyNzIsImV4cCI6MTY1MDk0NDI3MiwiaXNzIjoiemFsIiwidXNlckFjY291bnQiOiJsdjExMTEiLCJwZXJtaXNzaW9uIjoiQURNSU4iLCJ1c2VySWQiOjEwfQ.yOjjl0Snr6-Cs5Q1Ga1lDqtdkWmPQDdWUWu_ElrJhmY"
//获取token
function getToken(){
    setToken()
    return Cookies.get('tokenKey')
}
//设置token的函数，该函数应该传个值，token写死了所以没有传值
function setToken(){
    return Cookies.set('tokenKey', tokenKey)
}
//移除token
function removeToken(){
    return Cookies.remove(tokenKey)
}

const cookie = {
    getToken,
    setToken,
    removeToken
}

export default cookie